<!-- include tpl=header title=购物车 -->
<script type="text/javascript">
function cart_checkout()
{
	var id = $.checkbox.join();
	if(!id){
		$.dialog.alert('未指定要结算的产品');
		return false;
	}
	return true;
}
</script>
<section class="container"><div class="mt-3"><!-- include tpl=block/breadcrumb --></div></section>
<section class="container">
	<form method="post" action="{url ctrl=cart func=checkout/}" class="am-form" onsubmit="return cart_checkout()">
	<table class="table table-hover">
		<thead>
			<tr>
				<th colspan="2">图片</th>
				<th>名称</th>
				<th width="80px">数量</th>
				<th>售价</th>
			</tr>
		</thead>
		<tbody>
			<!-- loop from=$rslist key=$key value=$value id=$tmpid -->
			<tr>
				<td><input type="checkbox" name="id[]" id="id_{$value.id}" value="{$value.id}" checked onchange="$.cart.price()" /></td>
				<td>
					<!-- if $value.tid -->
					<a href="{url id=$value.tid/}" title="{$value.title}" target="_blank"><img src="{$value.thumb ? $value.thumb : 'images/nopic.png'}" width="80px" border="0" alt="{$value.title}" /></a>
					<!-- else -->
					<img src="{$value.thumb ? $value.thumb : 'images/nopic.png'}" width="80px" border="0" alt="{$value.title}" />
					<!-- /if -->
				</td>
				<td>
					<!-- if $value.tid -->
					<a href="{url id=$value.tid/}" title="{$value.title}" target="_blank"><h3 id="title_{$value.id}">{$value.title}</h3></a>
					<!-- else -->
					<h3 id="title_{$value.id}">{$value.title}</h3>
					<!-- /if -->
					<!-- loop from=$value._attrlist key=$k value=$v id=$tmpid -->
					<div>{$v.title}：{$v.content}</div>
					<!-- /loop -->
					<div>单价：{func price_format $value.price $value.currency_id}</div>
				</td>
				<td>
					<div><input type="number" class="form-control qty" min="1" name="qty_{$value.id}" id="qty_{$value.id}" value="{$value.qty}" onchange="$.cart.update('{$value.id}')" /></div>
				</td>
				<td class="text-danger">{func price_format $value.price*$value.qty $value.currency_id}</td>
			</tr>
			<!-- /loop -->
			<tr>
				<td colspan="5" class="text-right">当前选中的产品价格是：<span class="text-danger" id="total_price">{$price}</span></td>
				
			</tr>
		</tbody>
	</table>
	<div class="row mb-4">
		<div class="col">
			<div class="btn-group" role="group" aria-label="">
				<button type="button" class="btn btn-primary">全选</button>
				<button type="button" class="btn btn-primary">全不选</button>
				<button type="button" class="btn btn-primary">反选</button>
			</div>
			<input type="button" value="批量删除" onclick="$.cart.del()" class="btn btn-danger" />
		</div>
		<div class="col text-right">
			<button type="submit" class="btn btn-primary btn-lg">
				去结算
				<i class="fa fa-angle-right"></i>
			</button>
		</div>
	</div>
	</form>
</section>
<!-- include tpl=footer -->